//
//  GDeviceViewController.m
//  ClassManager
//
//  Created by ihope99 on 2017/8/16.
//  Copyright © 2017年 GZX. All rights reserved.
//

#import "GDeviceViewController.h"
#import "GDeviceManager.h"

@interface GDeviceViewController ()

@end

@implementation GDeviceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    UIButton *mButton = [UIButton buttonWithType:UIButtonTypeCustom];
    mButton.frame = CGRectMake(100, 100, 50, 50);
    [mButton setTitle:@"震动" forState:UIControlStateNormal];
    [mButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    [self.view addSubview:mButton];
    [mButton addTarget:self action:@selector(mZhenAction) forControlEvents:UIControlEventTouchUpInside];
    
    UIButton *mShengButton = [UIButton buttonWithType:UIButtonTypeCustom];
    mShengButton.frame = CGRectMake(100, 200, 50, 50);
    [mShengButton setTitle:@"声音" forState:UIControlStateNormal];
    [mShengButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    [self.view addSubview:mShengButton];
    [mShengButton addTarget:self action:@selector(mShengAction) forControlEvents:UIControlEventTouchUpInside];
    

    
}
-(void)mZhenAction{
    [GDeviceManager playVibration];
}
-(void)mShengAction{
    [GDeviceManager playNewMessageSoundWithPath:@"kaishi.wav"];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
